/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;

/**
 *
 * @author Human Booster
 */
@Entity
@Table(name = "licencecounterlimit")
@NamedQueries({
    @NamedQuery(name = "Licencecounterlimit.findAll", query = "SELECT l FROM Licencecounterlimit l"),
    @NamedQuery(name = "Licencecounterlimit.findById", query = "SELECT l FROM Licencecounterlimit l WHERE l.id = :id"),
    @NamedQuery(name = "Licencecounterlimit.findByLimit", query = "SELECT l FROM Licencecounterlimit l WHERE l.limit = :limit")})
public class Licencecounterlimit implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "limit")
    private int limit;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "licencecounterlimit")
    private Collection<Licencesoftware> licencesoftwareCollection;

    public Licencecounterlimit() {
    }

    public Licencecounterlimit(Integer id) {
        this.id = id;
    }

    public Licencecounterlimit(Integer id, int limit) {
        this.id = id;
        this.limit = limit;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public Collection<Licencesoftware> getLicencesoftwareCollection() {
        return licencesoftwareCollection;
    }

    public void setLicencesoftwareCollection(Collection<Licencesoftware> licencesoftwareCollection) {
        this.licencesoftwareCollection = licencesoftwareCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Licencecounterlimit)) {
            return false;
        }
        Licencecounterlimit other = (Licencecounterlimit) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Licencecounterlimit[ id=" + id + " ]";
    }
    
}
